home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / patches / pgs3g1.lha / 3.0gUpdate / Macros.LHA / PlaceGraphicAt.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-24  |  1KB  |  52 lines

  1. /* $VER: PlaceGraphicAt.rexx 1.0a (03.24.95)
  2.    Copyright 1995 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. OPTIONS RESULTS
  6. TRACE OFF
  7.  
  8. /* Make sure rexx support is opened */
  9. IF ~SHOW('L','rexxsupport.library') THEN
  10.     CALL ADDLIB('rexxsupport.library',0,-30)
  11. IF ~SHOW('L','softlogik:libs/slarexxsupport.library') THEN
  12.     CALL ADDLIB('softlogik:libs/slarexxsupport.library', 0, -30)
  13.  
  14. ADDRESS 'PAGESTREAM'
  15.  
  16. /* SELECT THE GRAPHIC */
  17. 'refresh wait'
  18. 'placegraphic status'
  19. if rc~=0 then signal cancel
  20.  
  21. /* GET THE OBJECT ID AND TYPE */
  22. 'getobject type objtype'
  23. objnum=result
  24. trace ?i
  25. /* POSITION THE PICTURE */
  26. getregion coord message '"Click or drag to place the picture."'
  27. if rc=10 then do
  28.     'deleteobject'
  29.     signal cancel
  30. end
  31. if (abs(p2d(coord.x1)-p2d(coord.x2)))<0.25 | (abs(p2d(coord.y1)-p2d(coord.y2)))<0.25 then DO
  32.     if objtype=12 then getpicture position pstem
  33.     if objtype=2 then getdrawing position pstem
  34.     if objtype=13 then geteps position pstem
  35.     coord.x2=p2d(pstem.right)+p2d(coord.x1)
  36.     coord.y2=p2d(pstem.bottom)+p2d(coord.y1)
  37. end
  38.  
  39.  
  40. if objtype=12 then editpicture position coord.x1 coord.y1 coord.x2 coord.y2
  41. if objtype=2 then editdrawing position coord.x1 coord.y1 coord.x2 coord.y2
  42. if objtype=13 then editeps position coord.x1 coord.y1 coord.x2 coord.y2
  43.  
  44. 'refresh continue'
  45.  
  46. EXIT
  47.  
  48.  
  49. CANCEL:
  50. 'refresh continue'
  51. EXIT
  52.